<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Admin</title>
	<link rel="stylesheet" type="text/css" href="JS/jquery_ui/jquery-ui.css"/>
	<link rel="stylesheet" type="text/css" href="css/main.css"/>
	<link rel="stylesheet" type="text/css" href="css/addOn.css"/>
	<link rel="stylesheet" type="text/css" href="css/style.css"/>		
	<script type="text/javascript" src="JS/jquery_ui/jquery.js"></script>
	<script type="text/javascript" src="JS/jquery_ui/jquery-ui.js"></script>
	 <script type="text/javascript" src="JS/jquery-1.11.1.min.js"></script>
	 <script type="text/javascript" src="JS/ckeditor/ckeditor.js"></script>
	 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	 <link rel="stylesheet" id="font-awesome-css" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" type="text/css" media="screen">
	<div id="fb-root"></div>
	<script type="text/javascript" src="JS/script.js"></script>
</head>
<body>
	<div class="r-main">
		<div class="r-header">
			<div class="site-left">
				<div class="menu">
					<ul>
						<li><a href="./PageLoad.article?rows=8&pages=1&keyword="><img src="Image/home.png"> <span>Home</span> </a></li>
						<li><a href="contact.jsp"><img src="Image/r_contact.PNG"> <span>Contact</span></a></li>
						<li><a href="about.jsp"><img src="Image/r_about.PNG"> <span>About</span></a></li>
					</ul>
				</div>
			</div>
			<div class="site-right">
			<%
				if(session.getAttribute("user") ==null){
			%>
				<span style=" background: none repeat scroll 0 0 hsl(0, 0%, 100%);clear: both; float: left;  padding: 5px; position: relative; right: 123px;top: 14px;">
					<div class="fb-share-button" data-href="https://www.facebook.com/pages/Article-Management-System/842186995792768?ref_type=bookmark"></div>
				</span>
				<span style="clear: left;float: left; margin: 0 auto;position: absolute;    right: 200px; top: 10px;">
					<object width='69' height='32'><embed src='http://www.socialbuttonmaker.com/Swfs/089f07a4-fbc7-4d8a-a477-6321546dd736/button.swf' type='application/x-shockwave-flash' width='69' height='32' loop='false' wmode='transparent'><noscript><a href='http://soccerisland.info/'>http://soccerisland.info/</a></noscript></embed><img src='' width=0 height=0 id='flashbutton'/><script type='text/javascript' src='http://www.socialbuttonmaker.com/Scripts/FlashButton.js'></script></object>
				</span>	
			<% 
				}
			%>						
			<script type="text/javascript">
			function list_author(){
				window.location.href="./admin_load.jsp";
			}
			function list_article(){
				window.location.href="./author_load.jsp";
			}
			</script>
				<ul>
					<%
						if(session.getAttribute("user")!=null){
						  String s= (String)session.getAttribute("user") ;
				  		  String firstLetter = s.substring(0,1).toUpperCase();
			     		  String restLetters = s.substring(1).toLowerCase();
			      	      String username=firstLetter + restLetters;
			      	      String position=(String)session.getAttribute("position");
						if(position.equalsIgnoreCase("admin")){
					%>
							<h4 class="username" onclick="list_author()"><%=username%></h4>
					<% 
						}else if(position.equalsIgnoreCase("author")){
					%>
						<h4 class="username" onclick="list_article()"><%=username%></h4>
					<% 
						}
					%>	
						<li><a href="./logout.article">Logout</a></li>
					<% 
						}else{
					%>
						<li><a href="./login.jsp">Login</a></li>
					<% 
						}
					%>
				</ul>
			</div>
		</div><!-- end header -->